package com.topevery.yllhdemo.controller;

import com.topevery.yllhdemo.model.Car;
import com.topevery.yllhdemo.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    private CarService carService;

    @GetMapping("/getCarById")
    public Car getCarById(Integer carId){
            return carService.getById(carId);
    }
}
